﻿namespace EveKillboard.Core.Views
{
    using System.ComponentModel.DataAnnotations;
    using System;


    public interface IKillmailView
    {
        int Id { get; set; }
        int? EveId { get; set; }
        int? CharacterId { get; set; }
        int CharacterInternalId { get; set; }
        string CharacterName { get; set; }
        int? CorporationId { get; set; }
        int? CorporationInternalId { get; set; }
        string CorporationName { get; set; }
        int? AllianceId { get; set; }
        int? AllianceInternalId { get; set; }
        string AllianceName { get; set; }
        int? FactionId { get; set; }
        string FactionName { get; set; }
        int DestroyedItemId { get; set; }
        string DestroyedItemName { get; set; }
        short ItemGroupId { get; set; }
        string DestroyedItemGroup { get; set; }
        DateTime Date { get; set; }
        int SystemId { get; set; }
        string SystemName { get; set; }
        int RegionId { get; set; }
        string RegionName { get; set; }
        float SystemTrueSecurity { get; set; }
        float SystemSecurity { get; set; }
        int InvolvedCount { get; set; }
        decimal KillmailValue { get; set; }
    }

    public abstract class KillmailView : IKillmailView
    {
        [Key]
        [Column("ID")]
        public int Id { get; set; }
        [Column("EveID")]
        public int? EveId { get; set; }
        [Column("CharacterID")]
        public int? CharacterId { get; set; }
        [Column("CharacterInternalID")]
        public int CharacterInternalId { get; set; }
        [Column("CharacterName")]
        public string CharacterName { get; set; }
        [Column("CorporationID")]
        public int? CorporationId { get; set; }
        [Column("CorporationInternalID")]
        public int? CorporationInternalId { get; set; }
        [Column("CorporationName")]
        public string CorporationName { get; set; }
        [Column("AllianceID")]
        public int? AllianceId { get; set; }
        [Column("AllianceInternalID")]
        public int? AllianceInternalId { get; set; }
        [Column("AllianceName")]
        public string AllianceName { get; set; }
        [Column("FactionID")]
        public int? FactionId { get; set; }
        [Column("FactionName")]
        public string FactionName { get; set; }
        [Column("ItemID")]
        public int DestroyedItemId { get; set; }
        [Column("ItemName")]
        public string DestroyedItemName { get; set; }
        [Column("GroupID")]
        public short ItemGroupId { get; set; }
        [Column("GroupName")]
        public string DestroyedItemGroup { get; set; }
        [Column("KillmailDate")]
        public DateTime Date { get; set; }
        [Column("SystemID")]
        public int SystemId { get; set; }
        [Column("SystemName")]
        public string SystemName { get; set; }
        [Column("RegionID")]
        public int RegionId { get; set; }
        [Column("RegionName")]
        public string RegionName { get; set; }
        [Column("SystemTrueSecurity", TypeName = "float")]
        public float SystemTrueSecurity { get; set; }
        [Column("SystemSecurity", TypeName = "float")]
        public float SystemSecurity { get; set; }
        [Column("InvolvedCount")]
        public int InvolvedCount { get; set; }
        [Column("KillmailValue")]
        public decimal KillmailValue { get; set; }
    }

    [Table("KillsView")]
    public class KillView : KillmailView
    {
    }
    [Table("LossesView")]
    public class LossView : KillmailView
    {
    }
    [Table("InvolvedCorporationKillsView")]
    public class CorporationKillView : KillmailView
    {
        [Column("InvolvedCorporationInternalID")]
        public int? InvolvedCorporationInternalId { get; set; }
    }
    [Table("InvolvedCharacterKillsView")]
    public class CharacterKillsView : KillmailView
    {
        [Column("InvolvedCharacterInternalID")]
        public int InvolvedCharacterInternalId { get; set; }
    }
    [Table("InvolvedAllianceKillsView")]
    public class AllianceKillView : KillmailView
    {
        [Column("InvolvedAllianceInternalID")]
        public int InvolvedAllianceInternalId { get; set; }
    }
}